package org.example.finaspringboot.mapper;

import org.apache.ibatis.annotations.*;
import org.example.finaspringboot.entity.User;

@Mapper
public interface UserMapper {
    @Select("SELECT * FROM users WHERE username = #{username}")
    User findByUsername(@Param("username") String username);

    @Insert("insert into User(username,password,phone,email) values(#{username},#{password},#{phone},#{email})")
    int insert(User user);

    @Update("UPDATE users SET password = #{password} WHERE username = #{username}")
    int updatePassword(User user);
}
